package com.example.study_manger.control;

import com.example.study_manger.tools.AliOSSutils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * 培训计划封面
 */
@RestController
public class uploadController {
    @Autowired
    private AliOSSutils aliOSSutils;
    @PostMapping("/uploadCover")
    public String upload(@RequestParam("file") MultipartFile file) throws IOException {
        return aliOSSutils.upload(file);
    }

}
